package com.zhang.zhangapp.http;

import com.zhang.zhangapp.base.config.HttpConfig;
import com.zhang.zhangapp.base.http.CommonCallBack;
import com.zhang.zhangapp.base.http.MCallback;
import com.zhang.zhangapp.utils.CreateMD5;
import com.zhang.zhangapp.utils.DateUtil;
import com.zhang.zhangapp.utils.enums.DateStyle;

import org.xutils.common.Callback;
import org.xutils.http.RequestParams;
import org.xutils.x;

import java.io.File;
import java.util.Date;


/**
 * Created by Administrator on 2017/7/12.
 */
public class UpLoadHttp {

    /**
     * 文件上傳
     * @param imagePaht
     * @param callback
     * @return
     */
    public static Callback.Cancelable upLoadFile(String imagePaht,MCallback callback){
        RequestParams params = new RequestParams(HttpConfig.UP_LOAD_PATH);
        params.addBodyParameter("file",new File(imagePaht));
        params.setMultipart(true);
        return x.http().post(params, new CommonCallBack(callback));
    }
}
